package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;

import java.util.Set;

import org.testng.annotations.Test;

public class DeleteGroupTests extends SuperClass {
	@Test
	public void testDeletGroupTrue() throws Exception {
		Set<GroupObject> existList = app.getGroupHelper().getGroups();
		app.getGroupHelper().deleteGroup(0); // action
		Set<GroupObject> newList = app.getGroupHelper().getGroups();
		verifyGroupDeleted(existList, newList);  // verification
	}

	private void verifyGroupDeleted(Set<GroupObject> existList,
			Set<GroupObject> newList) {
		assertThat(newList.size(), equalTo(existList.size() - 1));
	}
}
